package org.rency.common.mq.enums;

/**
 * 目的地类型
 * @author: user_rcy@163.com
 * </br>Created on 2016年4月8日
 * @version: V1.0.0
 * @since JDK 1.8
 */
public enum DestinationType {

	QUEUE("QUEUE",0),
	TOPIC("TOPIC",3),
	;
	
	private String code;
	private Integer value;
	
	DestinationType(String code,Integer value){
		this.code =code;
		this.value = value;
	}
	
	public String getCode(){
		return this.code;
	}
	
	public Integer getValue(){
		return this.value;
	}
	
	public static DestinationType get(String code){
		for(DestinationType nt : DestinationType.values()){
			if(nt.getCode().toUpperCase().equals(code.toUpperCase())){
				return nt;
			}
		}
		return null;
	}

	
}